<script setup lang="ts">
import router from "@/router";
import { useRoute } from "vue-router";

//params适合一个参数
const route = useRoute()


console.log(route.query.words);


</script>
<template>
  <div class="search">
  <!-- router时针对大的index -->
    <p >搜索关键字: {{ $route.query.words }}</p>
    <p>搜索结果: </p>
    <ul>
      <li>.............</li>
      <li>.............</li>
      <li>.............</li>
      <li>.............</li>
    </ul>
  </div>
</template>

<style>
.search {
  width: 400px;
  height: 240px;
  padding: 0 20px;
  margin: 0 auto;
  border: 2px solid #c4c7ce;
  border-radius: 5px;
}
</style>